﻿using AutoMapper;
using Blog.Core.Domain.Model;
using Blog.Core.Domain.Model.User;
using Blog.Core.DTO.ViewModel.From;
using Blog.Core.DTO.ViewModel.User;

namespace Blog.Core.Api.Config
{
    /// <summary>
    /// AutoMapper转换器
    /// </summary>
    public class AutoMapperProfile:Profile
    {
        public AutoMapperProfile()
        {
            CreateMap<UserInfo, RequestUserDTO>();
            CreateMap<RequestUserDTO, UserInfo>();
            CreateMap<RequestRolePermissionDTO, RolePermission>();

            CreateMap<ResponsePermissionTreeDTO, Permissions>();
            CreateMap<Permissions, ResponsePermissionTreeDTO>();
            CreateMap<RequestFromDTO,FromInfo>();
            CreateMap<FromInfo, RequestFromDTO>();
            CreateMap<RequestFromUpdateDTO, FromInfo>();
            CreateMap<FromInfo, RequestFromUpdateDTO>();
        }
    }
}
